<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="format-detection" content="telephone=no">
    <meta name="msapplication-tap-highsecondary" content="no">
    <meta name="viewport" content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width">

    <title>角色管理</title>
    <link href="../lib/fonts/material-icons.css?family=Material+Icons" rel="stylesheet">
    <link href="../lib/css/animate.min.css" rel="stylesheet">
    <link href="../lib/css/quasar.mat.rtl.min.css" rel="stylesheet" type="text/css">
    <style>
      [v-cloak] { display: none }
      .logoBg {
        width: 50px;height: 50px; background: url(../static/img/logoNew.png) no-repeat left center
      }
      div.q-field-vertical .q-field-label+.q-field-content { padding-top: 0!important }
      .search-group-left { font-size: 13px; border: 1px solid #ccc; padding: 3px 6px!important; border-radius: 3px 0 0 3px; border-right: none }
      .search-group-right { font-size: 13px;border: 1px solid #ccc; padding: 3px 6px!important; border-radius: 0 3px 3px 0 }
      .ant-input { font-size: 13px;border: 1px solid #ccc; padding: 3px 6px!important; border-radius: 3px }
    </style>
  </head>
  <body>
    <div id="q-list" v-cloak>
      <q-card class="bg-white no-shadow full-width">
        <q-card-main class="q-pa-sm">
          <q-table
          class="no-shadow"
          :data="data"
          dense
          :columns="columns"
          :rows-per-page-options="[5, 10, 20]"
          selection="multiple"
          row-key="id"
        >
          <template slot="top-left" slot-scope="props">
            <q-btn
              color="primary"
              outline
              size="sm"
              label="新增"
              class="q-mr-sm" ></q-btn>
            <q-btn
              color="negative"
              outline
              size="sm"
              label="删除"></q-btn>
          </template>
          <template slot="top-right" slot-scope="props">
              <q-input 
                class="search-group-left"
                hide-underline
                placeholder="输入查询"
                v-model.trim="searchForm.value"></q-input>
              <q-select 
                class="search-group-right"
                hide-underline
                radio
                :options="[{ label:'角色名', value: 'rName' }]"
                v-model="searchForm.key"></q-select>
              <q-btn
                size="sm"
                color="primary"
                class="q-ml-sm q-pa-sm">
                <span slot="loading">
                  <q-spinner-hourglass></q-spinner-hourglass>
                  搜索中
                </span>
                <q-icon name="search"></q-icon>
                <span>查询</span>
              </q-btn>
              <q-btn
                size="sm"
                color="secondary"
                class="q-ml-sm q-pa-sm">
                <span slot="loading">
                  <q-spinner-hourglass></q-spinner-hourglass>
                  重置中
                </span>
                <q-icon name="refresh" ></q-icon>
                <span>重置</span>
              </q-btn>
            </template>
            <template slot="body" slot-scope="props">
              <q-tr
                :props="props"
              >
                <q-td >
                  <q-checkbox color="primary" v-model="props.selected"></q-checkbox>
                </q-td>
                <q-td key="action" :props="props" >
                  <q-btn
                    flat
                    size="xs"
                    color="primary"
                  >
                  用户分配
                  </q-btn>
                </q-td>
                <q-td key="col2" :props="props">
                  {{props.row.col2}}
                </q-td>
              </q-tr>
            </template>
        </q-table>
        </q-card-main>
      </q-card>
    </div>
    
    <!-- ie-polyfill 、 vue.js and quasar-framework -->
    <script src="../lib/js/quasar.ie.polyfills.umd.min.js"></script>
    <script src="../lib/js/vue.js"></script>
    <script src="../lib/js/quasar.mat.umd.min.js"></script>
    <!-- quasar i18n zh-hans -->
    <script src="../lib/lang/zh-hans.js"></script>
    <!-- vue-i18n for application's internationalization -->
    <script src="../lib/js/vue-i18n.js"></script>
    <script>
      // quasar components use
      Quasar.i18n.set(Quasar.i18n['zhHans'])
			new Vue({
        el: '#q-list',
				data: function() {
					return {
            searchForm: {
              name: '',
              key: 'rName',
              value: ''
            },
            data: [
              {
                col2: '角色 1',
              },
              {
                col2: '角色 2',
              },
              {
                col2: '角色 3',
              },
              {
                col2: '角色 4',
              }
            ]
          }
				},
				computed: {
          columns: function() {
            return [
              {
                name: 'action',
                label: '操作',
                align: 'center',
                field: 'action'
              },
              {
                name: 'col2',
                label: '角色',
                align: 'center',
                field: 'col2'
              }
            ]
          }
        },
        watch: {
          
        },
        created: function() {
          
        },
				methods: {
					
				}
			})
    </script>
  </body>
</html>